<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveScaffold::DataStructures::Column</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveScaffold::DataStructures::Column</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../files/vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge_rb.html">
                vendor/plugins/active_scaffold/lib/bridges/file_column/lib/as_file_column_bridge.rb
                </a>
        <br />
                <a href="../../../files/vendor/plugins/active_scaffold/lib/data_structures/column_rb.html">
                vendor/plugins/active_scaffold/lib/data_structures/column.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000385">calculation?</a>&nbsp;&nbsp;
      <a href="#M000383">clear_link</a>&nbsp;&nbsp;
      <a href="#M000372">description</a>&nbsp;&nbsp;
      <a href="#M000397">field</a>&nbsp;&nbsp;
      <a href="#M000394">field_name</a>&nbsp;&nbsp;
      <a href="#M000378">form_ui</a>&nbsp;&nbsp;
      <a href="#M000386">includes=</a>&nbsp;&nbsp;
      <a href="#M000396">initialize_search_sql</a>&nbsp;&nbsp;
      <a href="#M000395">initialize_sort</a>&nbsp;&nbsp;
      <a href="#M000371">label</a>&nbsp;&nbsp;
      <a href="#M000379">list_ui</a>&nbsp;&nbsp;
      <a href="#M000382">options</a>&nbsp;&nbsp;
      <a href="#M000370">params</a>&nbsp;&nbsp;
      <a href="#M000390">plural_association?</a>&nbsp;&nbsp;
      <a href="#M000392">polymorphic_association?</a>&nbsp;&nbsp;
      <a href="#M000373">required?</a>&nbsp;&nbsp;
      <a href="#M000387">search_sql</a>&nbsp;&nbsp;
      <a href="#M000388">searchable?</a>&nbsp;&nbsp;
      <a href="#M000384">set_link</a>&nbsp;&nbsp;
      <a href="#M000389">singular_association?</a>&nbsp;&nbsp;
      <a href="#M000375">sort</a>&nbsp;&nbsp;
      <a href="#M000374">sort=</a>&nbsp;&nbsp;
      <a href="#M000377">sort_by</a>&nbsp;&nbsp;
      <a href="#M000376">sortable?</a>&nbsp;&nbsp;
      <a href="#M000391">through_association?</a>&nbsp;&nbsp;
      <a href="#M000380">ui_type</a>&nbsp;&nbsp;
      <a href="#M000381">ui_type=</a>&nbsp;&nbsp;
      <a href="#M000393">virtual?</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="../Configurable.html">ActiveScaffold::Configurable</a></span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">active_record_class</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">association</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
the association from the <a href="../../ActiveRecord.html">ActiveRecord</a>
class

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">calculate</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
define a calculation for the column. anything that
ActiveRecord::Calculations::ClassMethods#calculate accepts will do.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">collapsed</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
Whether this column set is collapsed by default in contexts where
collapsing is supported

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">column</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
the ConnectionAdapter::*<a href="Column.html">Column</a> object from the <a
href="../../ActiveRecord.html">ActiveRecord</a> class

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">css_class</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
this will be /joined/ to the :name for the td&#8216;s class attribute.
useful if you want to style columns on different ActiveScaffolds the same
way, but the columns have different names.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">description</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc">
a textual <a href="Column.html#M000372">description</a> of the column and
its contents. this will be displayed with any associated form input widget,
so you may want to consider adding a content example.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">file_column_display</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">form_ui</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc">
supported <a href="Column.html#M000382">options</a>:

<pre>
  * for association columns
    * :select - displays a simple &lt;select&gt; or a collection of checkboxes to (dis)associate records
</pre>
</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">includes</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
a collection of associations to pre-load when finding the records on a page

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">inplace_edit</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
Whether to enable inplace editing for this column. Currently works for text
columns, in the List.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">label</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc">
the display-name of the column. this will be used, for instance, as the
column title in the table and as the <a
href="Column.html#M000397">field</a> name in the form.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">link</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
associate an action_link with this column

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">list_ui</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">name</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
this is the name of the getter on the <a
href="../../ActiveRecord.html">ActiveRecord</a> model. it is the only
absolutely required attribute &#8230; all others will be inferred from this
name.

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">options</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
a place to store dev&#8216;s column specific <a
href="Column.html#M000382">options</a>

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">required</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc">
whether the <a href="Column.html#M000397">field</a> is required or not.
used on the form for visually indicating the fact to the user. TODO: move
into predicate

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">search_sql</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc">
describes how to search on a column

<pre>
  search = true           default, uses intelligent search sql
  search = &quot;CONCAT(a, b)&quot; define your own sql for searching. this should be the &quot;left-side&quot; of a WHERE condition. the operator and value will be supplied by ActiveScaffold.
</pre>
</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">table</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
the table name from the <a href="../../ActiveRecord.html">ActiveRecord</a>
class

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000385" class="method-detail">
        <a name="M000385"></a>

        <div class="method-heading">
          <a href="#M000385" class="method-signature">
          <span class="method-name">calculation?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
get whether to run a calculation on this column
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000385-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000385-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 121</span>
121:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">calculation?</span>
122:       <span class="ruby-operator">!</span>(<span class="ruby-ivar">@calculate</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">or</span> <span class="ruby-ivar">@calculate</span>.<span class="ruby-identifier">nil?</span>)
123:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000383" class="method-detail">
        <a name="M000383"></a>

        <div class="method-heading">
          <a href="#M000383" class="method-signature">
          <span class="method-name">clear_link</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
this should not only delete any existing link but also prevent column links
from being automatically added by later routines
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000383-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000383-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 102</span>
102:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clear_link</span>
103:       <span class="ruby-ivar">@link</span> = <span class="ruby-keyword kw">false</span>
104:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000372" class="method-detail">
        <a name="M000372"></a>

        <div class="method-heading">
          <a href="#M000372" class="method-signature">
          <span class="method-name">description</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000372-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000372-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 30</span>
30:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">description</span>
31:       <span class="ruby-identifier">as_</span>(<span class="ruby-ivar">@description</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@description</span>
32:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000394" class="method-detail">
        <a name="M000394"></a>

        <div class="method-heading">
          <a href="#M000394" class="method-signature">
          <span class="method-name">field_name</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
just the <a href="Column.html#M000397">field</a> (not table.field)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000394-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000394-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 204</span>
204:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">field_name</span>
205:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">virtual?</span>
206:       <span class="ruby-identifier">column</span> <span class="ruby-value">? </span><span class="ruby-ivar">@active_record_class</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">quote_column_name</span>(<span class="ruby-identifier">column</span>.<span class="ruby-identifier">name</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">association</span>.<span class="ruby-identifier">primary_key_name</span>
207:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000378" class="method-detail">
        <a name="M000378"></a>

        <div class="method-heading">
          <a href="#M000378" class="method-signature">
          <span class="method-name">form_ui</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000378-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000378-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 76</span>
76:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">form_ui</span>
77:       <span class="ruby-ivar">@form_ui</span>
78:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000386" class="method-detail">
        <a name="M000386"></a>

        <div class="method-heading">
          <a href="#M000386" class="method-signature">
          <span class="method-name">includes=</span><span class="method-args">(value)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000386-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000386-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 127</span>
127:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">includes=</span>(<span class="ruby-identifier">value</span>)
128:       <span class="ruby-ivar">@includes</span> = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">:</span> [<span class="ruby-identifier">value</span>] <span class="ruby-comment cmt"># automatically convert to an array</span>
129:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000371" class="method-detail">
        <a name="M000371"></a>

        <div class="method-heading">
          <a href="#M000371" class="method-signature">
          <span class="method-name">label</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000371-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000371-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 24</span>
24:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">label</span>
25:       <span class="ruby-identifier">as_</span>(<span class="ruby-ivar">@label</span>)
26:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000379" class="method-detail">
        <a name="M000379"></a>

        <div class="method-heading">
          <a href="#M000379" class="method-signature">
          <span class="method-name">list_ui</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000379-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000379-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 81</span>
81:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">list_ui</span>
82:       <span class="ruby-ivar">@list_ui</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@form_ui</span>
83:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000382" class="method-detail">
        <a name="M000382"></a>

        <div class="method-heading">
          <a href="#M000382" class="method-signature">
          <span class="method-name">options</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000382-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000382-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 94</span>
94:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span>
95:       <span class="ruby-ivar">@options</span> <span class="ruby-operator">||</span> {}
96:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000370" class="method-detail">
        <a name="M000370"></a>

        <div class="method-heading">
          <a href="#M000370" class="method-signature">
          <span class="method-name">params</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Any extra parameters this particular column uses. This is for create/update
purposes.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000370-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000370-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 17</span>
17:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">params</span>
18:       <span class="ruby-comment cmt"># lazy initialize</span>
19:       <span class="ruby-ivar">@params</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>
20:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000390" class="method-detail">
        <a name="M000390"></a>

        <div class="method-heading">
          <a href="#M000390" class="method-signature">
          <span class="method-name">plural_association?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000390-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000390-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 155</span>
155:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">plural_association?</span>
156:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span> <span class="ruby-keyword kw">and</span> [<span class="ruby-identifier">:has_many</span>, <span class="ruby-identifier">:has_and_belongs_to_many</span>].<span class="ruby-identifier">include?</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span>.<span class="ruby-identifier">macro</span>
157:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000392" class="method-detail">
        <a name="M000392"></a>

        <div class="method-heading">
          <a href="#M000392" class="method-signature">
          <span class="method-name">polymorphic_association?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000392-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000392-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 161</span>
161:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">polymorphic_association?</span>
162:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span>.<span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">:polymorphic</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:polymorphic</span>]
163:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000373" class="method-detail">
        <a name="M000373"></a>

        <div class="method-heading">
          <a href="#M000373" class="method-signature">
          <span class="method-name">required?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000373-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000373-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 40</span>
40:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">required?</span>
41:       <span class="ruby-ivar">@required</span>
42:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000387" class="method-detail">
        <a name="M000387"></a>

        <div class="method-heading">
          <a href="#M000387" class="method-signature">
          <span class="method-name">search_sql</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000387-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000387-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 135</span>
135:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">search_sql</span>
136:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">initialize_search_sql</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@search_sql</span> <span class="ruby-operator">===</span> <span class="ruby-keyword kw">true</span>
137:       <span class="ruby-ivar">@search_sql</span>
138:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000388" class="method-detail">
        <a name="M000388"></a>

        <div class="method-heading">
          <a href="#M000388" class="method-signature">
          <span class="method-name">searchable?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000388-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000388-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 139</span>
139:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">searchable?</span>
140:       <span class="ruby-identifier">search_sql</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">search_sql</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
141:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000384" class="method-detail">
        <a name="M000384"></a>

        <div class="method-heading">
          <a href="#M000384" class="method-signature">
          <span class="method-name">set_link</span><span class="method-args">(action, options = {})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000384-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000384-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 106</span>
106:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_link</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">options</span> = {})
107:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">action</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">ActiveScaffold</span><span class="ruby-operator">::</span><span class="ruby-constant">DataStructures</span><span class="ruby-operator">::</span><span class="ruby-constant">ActionLink</span>
108:         <span class="ruby-ivar">@link</span> = <span class="ruby-identifier">action</span>
109:       <span class="ruby-keyword kw">else</span>
110:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:label</span>] <span class="ruby-operator">||=</span> <span class="ruby-ivar">@label</span>
111:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:position</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">:after</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:position</span>)
112:         <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:type</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">:record</span>
113:         <span class="ruby-ivar">@link</span> = <span class="ruby-constant">ActiveScaffold</span><span class="ruby-operator">::</span><span class="ruby-constant">DataStructures</span><span class="ruby-operator">::</span><span class="ruby-constant">ActionLink</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">action</span>, <span class="ruby-identifier">options</span>)
114:       <span class="ruby-keyword kw">end</span>
115:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000389" class="method-detail">
        <a name="M000389"></a>

        <div class="method-heading">
          <a href="#M000389" class="method-signature">
          <span class="method-name">singular_association?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000389-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000389-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 152</span>
152:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">singular_association?</span>
153:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span> <span class="ruby-keyword kw">and</span> [<span class="ruby-identifier">:has_one</span>, <span class="ruby-identifier">:belongs_to</span>].<span class="ruby-identifier">include?</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span>.<span class="ruby-identifier">macro</span>
154:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000375" class="method-detail">
        <a name="M000375"></a>

        <div class="method-heading">
          <a href="#M000375" class="method-signature">
          <span class="method-name">sort</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000375-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000375-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 58</span>
58:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort</span>
59:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">initialize_sort</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@sort</span> <span class="ruby-operator">===</span> <span class="ruby-keyword kw">true</span>
60:       <span class="ruby-ivar">@sort</span>
61:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000374" class="method-detail">
        <a name="M000374"></a>

        <div class="method-heading">
          <a href="#M000374" class="method-signature">
          <span class="method-name">sort=</span><span class="method-args">(value)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
sorting on a column can be configured four ways:
</p>
<pre>
  sort = true               default, uses intelligent sorting sql default
  sort = false              sometimes sorting doesn't make sense
  sort = {:sql =&gt; &quot;&quot;}       define your own sql for sorting. this should be result in a sortable value in SQL. ActiveScaffold will handle the ascending/descending.
  sort = {:method =&gt; &quot;&quot;}    define ruby-side code for sorting. this is SLOW with large recordsets!
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000374-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000374-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 49</span>
49:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort=</span>(<span class="ruby-identifier">value</span>)
50:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
51:         <span class="ruby-identifier">value</span>.<span class="ruby-identifier">assert_valid_keys</span>(<span class="ruby-identifier">:sql</span>, <span class="ruby-identifier">:method</span>)
52:         <span class="ruby-ivar">@sort</span> = <span class="ruby-identifier">value</span>
53:       <span class="ruby-keyword kw">else</span>
54:         <span class="ruby-ivar">@sort</span> = <span class="ruby-identifier">value</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">false</span> <span class="ruby-comment cmt"># force true or false</span>
55:       <span class="ruby-keyword kw">end</span>
56:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000377" class="method-detail">
        <a name="M000377"></a>

        <div class="method-heading">
          <a href="#M000377" class="method-signature">
          <span class="method-name">sort_by</span><span class="method-args">(options)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
a configuration helper for the self.sort property. simply provides a method
syntax instead of setter syntax.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000377-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000377-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 68</span>
68:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sort_by</span>(<span class="ruby-identifier">options</span>)
69:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sort</span> = <span class="ruby-identifier">options</span>
70:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000376" class="method-detail">
        <a name="M000376"></a>

        <div class="method-heading">
          <a href="#M000376" class="method-signature">
          <span class="method-name">sortable?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000376-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000376-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 63</span>
63:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortable?</span>
64:       <span class="ruby-identifier">sort</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">false</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sort</span>.<span class="ruby-identifier">nil?</span>
65:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000391" class="method-detail">
        <a name="M000391"></a>

        <div class="method-heading">
          <a href="#M000391" class="method-signature">
          <span class="method-name">through_association?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000391-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000391-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 158</span>
158:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">through_association?</span>
159:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">association</span>.<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:through</span>]
160:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000380" class="method-detail">
        <a name="M000380"></a>

        <div class="method-heading">
          <span class="method-name">ui_type</span><span class="method-args">()</span>
        </div>
      
        <div class="method-description">
          <p>
Alias for <a href="Column.html#M000378">form_ui</a>
</p>
        </div>
      </div>

      <div id="method-M000381" class="method-detail">
        <a name="M000381"></a>

        <div class="method-heading">
          <a href="#M000381" class="method-signature">
          <span class="method-name">ui_type=</span><span class="method-args">(val)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000381-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000381-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 87</span>
87:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ui_type=</span>(<span class="ruby-identifier">val</span>)
88:       <span class="ruby-operator">::</span><span class="ruby-constant">ActiveSupport</span><span class="ruby-operator">::</span><span class="ruby-constant">Deprecation</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;config.columns[:#{name}].ui_type will disappear in version 2.0. Please use config.columns[:#{name}].form_ui instead.&quot;</span>, <span class="ruby-identifier">caller</span>)
89:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">form_ui</span> = <span class="ruby-identifier">val</span>
90:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000393" class="method-detail">
        <a name="M000393"></a>

        <div class="method-heading">
          <a href="#M000393" class="method-signature">
          <span class="method-name">virtual?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
an interpreted property. the column is virtual if it isn&#8216;t from the
active record model or any associated models
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000393-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000393-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 166</span>
166:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">virtual?</span>
167:       <span class="ruby-identifier">column</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">association</span>.<span class="ruby-identifier">nil?</span>
168:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000397" class="method-detail">
        <a name="M000397"></a>

        <div class="method-heading">
          <a href="#M000397" class="method-signature">
          <span class="method-name">field</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
the table.field name for this column, if applicable
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000397-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000397-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 243</span>
243:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">field</span>
244:       <span class="ruby-ivar">@field</span> <span class="ruby-operator">||=</span> [<span class="ruby-ivar">@table</span>, <span class="ruby-identifier">field_name</span>].<span class="ruby-identifier">join</span>(<span class="ruby-value str">'.'</span>)
245:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000396" class="method-detail">
        <a name="M000396"></a>

        <div class="method-heading">
          <a href="#M000396" class="method-signature">
          <span class="method-name">initialize_search_sql</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000396-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000396-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 226</span>
226:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_search_sql</span>
227:       <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">virtual?</span>
228:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_sql</span> = <span class="ruby-keyword kw">nil</span>
229:       <span class="ruby-keyword kw">else</span>
230:         <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">association</span>.<span class="ruby-identifier">nil?</span>
231:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_sql</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">field</span>.<span class="ruby-identifier">to_s</span>
232:         <span class="ruby-keyword kw">else</span>
233:           <span class="ruby-comment cmt"># with associations we really don't know what to sort by without developer intervention. we could sort on the primary key ('id'), but that's hardly useful. previously ActiveScaffold would try and search using the same sql as from :sort, but we decided to just punt.</span>
234:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">search_sql</span> = <span class="ruby-keyword kw">nil</span>
235:         <span class="ruby-keyword kw">end</span>
236:       <span class="ruby-keyword kw">end</span>
237:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000395" class="method-detail">
        <a name="M000395"></a>

        <div class="method-heading">
          <a href="#M000395" class="method-signature">
          <span class="method-name">initialize_sort</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000395-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000395-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/data_structures/column.rb, line 211</span>
211:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize_sort</span>
212:       <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">virtual?</span>
213:         <span class="ruby-comment cmt"># we don't automatically enable method sorting for virtual columns because it's slow, and we expect fewer complaints this way.</span>
214:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sort</span> = <span class="ruby-keyword kw">false</span>
215:       <span class="ruby-keyword kw">else</span>
216:         <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">singular_association?</span>
217:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sort</span> = {<span class="ruby-identifier">:method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{self.name}.to_s&quot;</span>}
218:         <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">plural_association?</span>
219:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sort</span> = {<span class="ruby-identifier">:method</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-node">&quot;#{self.name}.join(',')&quot;</span>}
220:         <span class="ruby-keyword kw">else</span>
221:           <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sort</span> = {<span class="ruby-identifier">:sql</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">field</span>}
222:         <span class="ruby-keyword kw">end</span>
223:       <span class="ruby-keyword kw">end</span>
224:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>